package com.luych.toolbox.data.service.convert;

import com.luych.toolbox.common.feign.param.data.service.DataTransporterHistoryParam;
import com.luych.toolbox.common.service.base.BaseConvert;
import com.luych.toolbox.data.service.entity.DataTransporterHistory;
import org.springframework.beans.BeanUtils;

public class DataTransporterHistoryParamToEntity implements BaseConvert<DataTransporterHistoryParam, DataTransporterHistory> {

    @Override
    public DataTransporterHistory target() {
        return new DataTransporterHistory();
    }

    @Override
    public void accept(DataTransporterHistoryParam source, DataTransporterHistory target) {
        BeanUtils.copyProperties(source, target, "tables", "tableMap");
        target.setTableMap(source.getTables());
    }
}
